﻿ <div id="pagedList">
@*    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount*@   
   Trang
    @for (int i = 1; i <= Model.PageCount; i++)
    {
        int currntPage = Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber;
        if (i ==currntPage)
        {
        @Html.ActionLink(" [" + i + "]  ", "Index", new { page = i, sort = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter },  new { @class = "CurrentPage" });
        }
        else
        {
        @Html.ActionLink(" [" + i + "]  ", "Index", new { page = i, sort = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter });
        }
    } 
     Tổng số trang:(@Model.PageCount)
   @* @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "Index", new { page = 1, sort = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "Index", new { page = Model.PageNumber - 1, sort = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev
    }
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "Index", new { page = Model.PageNumber + 1, sort = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Index", new { page = Model.PageCount, sort = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:Next >
        @Html.Raw(" ")
        @:>>
    }*@
</div>
